import React from "react";
import "./header.less";
import { string } from "prop-types";

// memo可以防止子组件的重新渲染
const Header = React.memo((props) => {
  return (
    <header className="header">
      {props.title}
      {props.children}
    </header>
  );
});

Header.defaultProps = {
  title: "猫眼电影",
};

Header.propTypes = {
  title: string,
};

export default Header;
